package services.LoginDisplay;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import controllers.displayEntites.LoginDisplay;
import core.dao.Dao;
import core.dao.LoginDisplayService;
import entities.test.TestEntity;

@Service(value = "loginDisplayServiceImpl")
public class LoginDisplayServiceImpl implements LoginDisplayService {

	@Resource(name = "dao")
	private Dao<TestEntity> dao;

	/**
	 * 查询登录者并对LoginDisplay初始化
	 */
	@Override
	public LoginDisplay getLogin(String nickName, String passWord)
			throws Exception {
		List<TestEntity> list = dao.select(TestEntity.class,
				"select x from TestEntity as x where x.id= 1");
		for (TestEntity test : list) {
			System.out.println(test.getNumberTestInteger());
			System.out.println(test.getNumberTest());

		}
		// List<AccountEntity> aeL = dao.select(AccountEntity.class,
		// "from AccountEntity where nickName='" + nickName
		// + "' and passWord='" + passWord + "'");
		// if (aeL != null && aeL.size() == 1) {
		// LoginDisplay ld = new LoginDisplay();
		// int[] randomAB = ld.randomAB();
		// ld.set(aeL.get(0), randomAB[0], randomAB[1]);
		// return ld;
		// }
		return null;
	}
}
